package model;

/**
 * @author Dumella De Rosa Gennaro
 *
 */
public class Link {

	/** Identificativo univoco del link */
	// gestire la generazione di ID univoci !!!!
	// Cambiare in int o long...
	private String id;
	
	/** Il punto di partenza del link */
	private NetworkInterface source;
	
	/** Il punto di arrivo del link (può essere un'altra Interface o un Hub) */
	private Device destination;
	
	/** True se e' un link full duplex */
	private boolean isFullDuplex;

	/**
	 * @param id
	 * @param source
	 * @param destination
	 * @param isFullDuplex
	 */
	public Link(String id, NetworkInterface source, Device destination, boolean isFullDuplex) {
		// TODO gestire univocita' id
		this.id = id;
		this.source = source;
		this.destination = destination;
		this.isFullDuplex = isFullDuplex;
	}
	
	/* Metodi GET, SET, Add, Remove e Is */
	/**
	 * @return the id
	 */
	public String getId() {
		return id;
	}

	/**
	 * @param id
	 *            the id to set
	 */
	public void setId(String id) {
		this.id = id;
	}
	
	/**
	 * @return the source
	 */
	public NetworkInterface getSource() {
		return source;
	}

	/**
	 * @param source
	 *            the source to set
	 */
	public void setSource(NetworkInterface source) {
		this.source = source;
	}

	/**
	 * @return the destination
	 */
	public Device getDestination() {
		return destination;
	}

	/**
	 * @param destination
	 *            the destination to set
	 */
	public void setDestination(Device destination) {
		this.destination = destination;
	}
	
	/**
	 * @return the isFullDuplex
	 */
	public boolean isFullDuplex() {
		return isFullDuplex;
	}

	/**
	 * @param isFullDuplex
	 *            the isFullDuplex to set
	 */
	public void setFullDuplex(boolean isFullDuplex) {
		this.isFullDuplex = isFullDuplex;
	}

}